package com.itheima.wisdomnext.mapper;

import com.itheima.wisdomnext.entity.QaAnswerOption;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface QaAnswerOptionMapper {

    // 插入问答选项
    @Insert("INSERT INTO qa_answer_options (question_id, option_text) " +
            "VALUES (#{questionId}, #{optionText})")
    void insertOption(QaAnswerOption option);

    // 根据问题 ID 查询所有选项
    @Select("SELECT * FROM qa_answer_options WHERE question_id = #{questionId}")
    List<QaAnswerOption> selectOptionsByQuestionId(int questionId);
}
